package com.kaikeba.bean;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * @Author: 平川
 * @Description:
 * @Date Created in 2021-08-02 21:06
 * @Modified By:
 */
public class User {
    private int id;
    private String username;
    private String phonenumber;
    private String password;
    private String cardid;
    private Timestamp intime;
    private Timestamp outtime;

    public User() {
    }

    public String getCardid() {
        return cardid;
    }

    public void setCardid(String cardid) {
        this.cardid = cardid;
    }

    public User(int id, String username, String phonenumber, String password, String cardid, Timestamp intime, Timestamp outtime) {
        this.id = id;
        this.username = username;
        this.phonenumber = phonenumber;
        this.password = password;
        this.cardid = cardid;
        this.intime = intime;
        this.outtime = outtime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPhonenumber() {
        return phonenumber;
    }

    public void setPhonenumber(String phonenumber) {
        this.phonenumber = phonenumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getIntime() {
        return intime;
    }

    public void setIntime(Timestamp intime) {
        this.intime = intime;
    }

    public Timestamp getOuttime() {
        return outtime;
    }

    public void setOuttime(Timestamp outtime) {
        this.outtime = outtime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id &&
                Objects.equals(username, user.username) &&
                Objects.equals(phonenumber, user.phonenumber) &&
                Objects.equals(password, user.password) &&
                Objects.equals(cardid, user.cardid) &&
                Objects.equals(intime, user.intime) &&
                Objects.equals(outtime, user.outtime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, phonenumber, password, cardid, intime, outtime);
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", phonenumber='" + phonenumber + '\'' +
                ", password='" + password + '\'' +
                ", cardid='" + cardid + '\'' +
                ", intime=" + intime +
                ", outtime=" + outtime +
                '}';
    }
}
